﻿@model Century.Model.CMS.SitePage
@{
    Layout = null;
    var options = new AjaxOptions()
    {
        Url = Url.Action("Properties", "PageManagement"),
        UpdateTargetId = "Result",
        OnSuccess = "OnSuccess",
        OnFailure = "OnFailure"
    };  
}
 @section scripts{
@Html.Partial("_MessageBox")
<script type="text/javascript">
    $(document).ready(function () {
        $('#PostIT').click(function () {
            $(this).parents('form').submit();
            return false;
        });
    });

    function OnSuccess(data) {
        ReloadTree();
        OpenPopup('Message', 'Site page properties successfully saved.');
    }

    function OnFailure(data) {
        OpenPopup('Message', 'An error occured during save operation. <br/>Please try again or contact with administrator.', true);
    }
</script>
     }
@{Html.EnableClientValidation();}
@using (Ajax.BeginForm(options))
{
    @Html.ValidationSummary(true);
    <div style="text-align: left;">
        <div>
            <table border="0" cellspacing="0" cellpadding="0" class="login-tbl">
                <tr>
                    <td colspan="2">
                        <h2>
                            Edit "@(string.IsNullOrEmpty(Model.Title) ? Model.LocalName : Model.Title)" Properties
                            @Html.HiddenFor(model => model.Id)
                            @Html.HiddenFor(model => model.SiteId)
                            @Html.HiddenFor(model => model.PageLayoutId)
                            @Html.HiddenFor(model => model.Name)
                            @Html.HiddenFor(model => model.LocalName)
                            @Html.HiddenFor(model => model.Title)
                            @Html.HiddenFor(model => model.Url)
                            @Html.HiddenFor(model => model.NodeOrder)
                            @Html.HiddenFor(model => model.MenuDescription)
                            @Html.HiddenFor(model => model.ImagePath)
                            @Html.HiddenFor(model => model.IsHomePage)
                            @Html.HiddenFor(model => model.ShowInMenu)
                        </h2>
                        <br />
                        <img src="@Url.Content("~/Areas/Admin/Content/themes/admin/img/general/warning.png")" alt="Warning"> Your changes will be appear on <b>Live</b>. There is no draft or etc. version for these properties
                    </td>
                </tr>
                <tr>
                    <td class="lbl">
                        @Html.LabelFor(model => model.Keywords)
                    </td>
                    <td>
                        @Html.TextAreaFor(model => model.Keywords, new { @class = "big high" })
                    </td>
                </tr>
                <tr>
                    <td class="lbl">
                        @Html.LabelFor(model => model.Description)
                    </td>
                    <td>
                        @Html.TextAreaFor(model => model.Description, new { @class = "big high" })
                    </td>
                </tr>
                <tr>
                    <td class="lst" colspan="2">
                        <input type="submit" class="btn_green btn" id="PostIT" value="Save" />
                    </td>
                </tr>
                <tr>
                    <td class="lst" colspan="2">
                        <span id="processResult"></span>
                    </td>
                </tr>
            </table>
        </div>
    </div>
}
